package com.yy.service.impl;

import java.util.List;


import com.yy.common.utils.DateUtils;
import com.yy.domain.AssetHouse;
import com.yy.mapper.AssetHouseMapper;
import com.yy.service.IAssetHouseService;
import com.yy.vo.AssetHouseImpVo;
import com.yy.vo.AssetHouseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;




/**
 * 商铺管理Service业务层处理
 * 
 * @author leige
 * @date 2023-10-26
 */
@Service
public class AssetHouseServiceImpl implements IAssetHouseService
{
    @Autowired
    private AssetHouseMapper assetHouseMapper;

    /**
     * 查询商铺管理
     * 
     * @param id 商铺管理主键
     * @return 商铺管理
     */
    @Override
    public AssetHouse selectAssetHouseById(Long id)
    {
        return assetHouseMapper.selectAssetHouseById(id);
    }

    /**
     * 查询商铺管理列表
     *
     * @param assetHouse 商铺管理
     * @return 商铺管理
     */
    @Override
    public List<AssetHouseVo> selectAssetHouseList(AssetHouse assetHouse)
    {
        return assetHouseMapper.selectAssetHouseList(assetHouse);
    }

    /**
     * 新增商铺管理
     * 
     * @param assetHouse 商铺管理
     * @return 结果
     */
    @Override
    public int insertAssetHouse(AssetHouse assetHouse)
    {
        assetHouse.setCreateTime(DateUtils.getNowDate());
        return assetHouseMapper.insertAssetHouse(assetHouse);
    }

    /**
     * 修改商铺管理
     * 
     * @param assetHouse 商铺管理
     * @return 结果
     */
    @Override
    public int updateAssetHouse(AssetHouse assetHouse)
    {
        assetHouse.setUpdateTime(DateUtils.getNowDate());
        return assetHouseMapper.updateAssetHouse(assetHouse);
    }

    /**
     * 批量删除商铺管理
     * 
     * @param ids 需要删除的商铺管理主键
     * @return 结果
     */
    @Override
    public int deleteAssetHouseByIds(Long[] ids)
    {
        return assetHouseMapper.deleteAssetHouseByIds(ids);
    }

    /**
     * 删除商铺管理信息
     * 
     * @param id 商铺管理主键
     * @return 结果
     */
    @Override
    public int deleteAssetHouseById(Long id)
    {
        return assetHouseMapper.deleteAssetHouseById(id);
    }

    /**
     * 根据商铺ID查询商铺信息
     * @param id
     * @return
     */
    @Override
    public AssetHouseImpVo queryAllResourceByHouseId(Long id) {
        return this.assetHouseMapper.queryAllResourceByHouseId(id);
    }
}
